//
//  MyDocument.h
//  Documents
//
//  Created by Alex Di Mango 
//  Copyright (c) 2012 Whardoo.com -  All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "MyDocumentsFolder.h"

@class MyDocumentsFolder;

@interface MyDocument : NSManagedObject<DocumentProtocol>

@property (nonatomic, retain) NSNumber * documentId;
@property (nonatomic, retain) NSString * author;
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * filePath;
@property (nonatomic, retain) NSString * fileType;
@property (nonatomic, retain) NSNumber * size;
@property (nonatomic, retain) NSNumber * marked;
@property (nonatomic, retain) NSDate * updateDate;
@property (nonatomic, retain) NSData * image;
@property (nonatomic, retain) NSData * imageRef;
@property (nonatomic, retain) NSData * sideImage;
@property (nonatomic, retain) NSData * sideImageRef;


@property (nonatomic, retain) MyDocumentsFolder *myFolder;

+(MyDocument *)getDocumentWithId:(NSNumber *)documentId;
+(MyDocument *)getDocumentWithNameAndFileType:(NSString *)name andFiletype:(NSString *)fileType;
+(NSArray *)getDocumentListForFolderId:(NSNumber *)folderId;
+(NSArray *)myDocuments;
+(NSNumber *)getMaxDocumentId;
+(MyDocument *) addDocument: (NSURL *) url;
+(NSArray *)getDocumentListForCurrMyFolderId:(NSNumber *)currMyFolderId;
+(void)deleteSelectedDocument:(MyDocument *)myDocument;
+(NSArray *)getDocumentListWithName:(NSString *)name forFolder:(NSNumber *)folderId orderBy:(NSString *)orderingField ascending:(BOOL)ascending;
+(MyDocument *)getDocumentWithName:(NSString *)documentName;
-(NSString*)localDocPath;

@end
